﻿using FastCloud.Base.Desgin;
using FastCloud.Base.Entity;
using FastUtil.Data;
using System;
using System.Collections.Generic;
using System.Text;

namespace FastCloud.Base.DB
{
    public class DB_AttachStorage : BaseML<Frame_AttachStorage>
    {
        public override void Insert(Frame_AttachStorage Entity)
        {
            if (string.IsNullOrEmpty(Entity.AttachStorageGuid))
            {
                Entity.AttachStorageGuid = GenerateUtil.GenerateRowGuid();
            }
            Entity.AddDate = DateTime.Now;
            base.Insert(Entity);
        }

        public override void InsertBatch(List<Frame_AttachStorage> EntityList)
        {
            foreach (Frame_AttachStorage Entity in EntityList)
            {
                if (string.IsNullOrEmpty(Entity.AttachStorageGuid))
                {
                    Entity.AttachStorageGuid = GenerateUtil.GenerateRowGuid();
                }
                Entity.AddDate = DateTime.Now;
            }
            base.InsertBatch(EntityList);
        }
    }
}
